package com.briup.recognition.service.impl;


import com.briup.recognition.bean.BaseFile;
import com.briup.recognition.bean.BaseFileExample;
import com.briup.recognition.dao.BaseFileMapper;
import com.briup.recognition.service.IBaseFileService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: 黎海梅
 * @Date: 2021/03/28/19:57
 * @Description:
 */
@Service
public class BaseFileServiceImpl implements IBaseFileService{

    @Resource
    private BaseFileMapper baseFileMapper;

    @Override
    public List<BaseFile> query(){

        BaseFileExample example = new BaseFileExample();

        return baseFileMapper.selectByExample(example);
    }

    @Override
    public void saveOrUpdate(BaseFile baseFile){
        baseFileMapper.updateByPrimaryKey(baseFile);

//        if (baseFile.getId()!=null){
//            baseFileMapper.updateByPrimaryKey(baseFile);
//        }else {
//            baseFileMapper.insert(baseFile);
//        }
    }

    @Override
    public void deleteById(String id){
        baseFileMapper.deleteByPrimaryKey(id);
    }

}
